package com.cn.ycy.aop.xml;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AopTest {

  @Test
  public void test2() {
    //通过配置文件 来实现aop
    ClassPathXmlApplicationContext classPathXmlApplicationContext =
            new ClassPathXmlApplicationContext("springcontext.xml");

    Object countImpl = classPathXmlApplicationContext.getBean("countImpl");
    CountImpl count = (CountImpl) countImpl;

    count.goBack();

  }

  @Test
  public void test3() {
    //通过配置文件 来实现aop
    ClassPathXmlApplicationContext classPathXmlApplicationContext =
            new ClassPathXmlApplicationContext("springcontext.xml");
    Object countImpl = classPathXmlApplicationContext.getBean("countImpl");
    CountImpl count = (CountImpl) countImpl;

    count.doWork();
    System.out.println();

  }


}
